<template>
  <div>
    <h1>{{title}}</h1>
    <div>
      <span>
        {{container}}
      </span>
    </div>
    <button @click="emitToParent">字体变大</button>
    <!--插槽-->
    <slot></slot>
    <slot :value1 = "soltValue" :value2="soltValue2" name="one">这是one</slot>
  </div>
</template>

<script>
  export default {
    name: "my-label",
    //接收父组件传递数据
    props: {
      title: String,
      container: String
    },
    data(){
      return {
        soltValue:0,
        soltValue2:2
      }
    },
    methods: {
      emitToParent(){
        this.$emit("child-event",5)
      }
    }
  }
</script>

<style scoped>

</style>
